package o;

import com.huawei.appgallery.jsonkit.api.annotation.FieldSecurity;
import com.huawei.appgallery.jsonkit.api.annotation.SecurityLevel;
import com.huawei.appmarket.service.appmgr.bean.UsageAppInfo;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class dsk extends cvs {
    public static final String APIMETHOD = "client.usageAppListRep";
    private static final String TAG = "LastUsedAppRequest";
    private List<UsageAppInfo> appInfoList;
    @FieldSecurity(security = SecurityLevel.PRIVACY)
    private String usageAppInfoList_;

    public dsk() {
        setMethod_(APIMETHOD);
    }

    protected void onSetValue() {
        super.onSetValue();
        if (!CollectCheck.isEmpty(this.appInfoList)) {
            JSONArray jSONArray = new JSONArray();
            for (UsageAppInfo toJson : this.appInfoList) {
                try {
                    jSONArray.put(new JSONObject(toJson.toJson()));
                } catch (JSONException e) {
                    Logger.e(TAG, "JSONException");
                } catch (IllegalAccessException e2) {
                    Logger.e(TAG, "IllegalAccessException");
                }
            }
            this.usageAppInfoList_ = jSONArray.toString();
        }
    }

    public void ˏ(List<UsageAppInfo> list) {
        this.appInfoList = list;
    }
}
